﻿/// <reference path="../../../Common/JQ/jquery-1.10.2.min.js" />
/// <reference path="../../../Common/EasyUI/jquery.easyui.min.js" />
/// <reference path="../../../Common/MyJS/MyWebsite.js" />

//文档加载完毕之后触发的事件
$(document).ready(function () {
    pageInitial();
    loadArchiveClass();
    loadArchiveData();
});

function pageInitial() {
    /// <summary>页面的初始化</summary>
    //先创建布局
    $(document.body).layout();
    //配置图标按钮
    $($(document.body).layout('panel', 'west')).panel({
        tools: [{
            iconCls: 'icon-config',
            handler: function () {
                var sUrl = MyWebsite.getServerAddr() + "MISCommon/ArchiveSystem/Manager.aspx";
                var sTitle = top1.getActiveTabTitle();
                var id = MyWebsite.getQueryParam("id");
                sUrl = MyString.urlAppend(sUrl, "id=" + id);
                sUrl = MyString.urlAppend(sUrl, "title=" + sTitle);
                sUrl = MyWebsite.encodeUrl(sUrl);
                top1.addPage(sUrl, "配置--" + sTitle);
            }
        }]
    });
    //需要重新调用这个布局方法，否则那个图标的样式不对
    $(document.body).layout();
};

function loadArchiveClass() {
    /// <summary>加载管理系统的分类</summary>
    $("#ul_archiveClass").tree({
        data:[]
    });
};

function loadArchiveData() {
    /// <summary>加载数据</summary>
    $('#tb_archiveData').datagrid({
        toolbar: [{
            iconCls: 'icon-edit',
            handler: function () { alert('edit') }
        }, '-', {
            iconCls: 'icon-help',
            handler: function () { alert('help') }
        }]
    });
};

function configArchiveSys() {
    /// <summary>配置管理系统</summary>
};

